package java06;
import java.util.*;
public class HashMapTest03 {
    public static void main(String[] args){
        Map map = new HashMap();
        map.put("1","Jack");
        map.put("2","Rose");
        map.put("3","Luck");
        System.out.println(map);
        Set entrySet = map.entrySet();
        Iterator it = entrySet.iterator();//获取Iterator对象
        while(it.hasNext()){
            Map.Entry  entry = (Map.Entry) (it.next());//获取集合中键值对映射关系
            Object key = entry.getKey();//获取Entry中的键
            Object value = entry.getValue();//获取Entry中值
            System.out.println(key + ":" + value);
        }

    }
}
